import {IsEmail, IsNotEmpty, MinLength} from 'class-validator';
import {ApiProperty} from '@nestjs/swagger';

export class RegisterUserDto {
    @IsNotEmpty({
        message: '用户名不能为空',
    })
    @ApiProperty({description: '用户名', required: true})
    username: string;

    @IsNotEmpty({
        message: '手机号不能为空',
    })
    @ApiProperty({description: '手机号', required: false})
    phoneNumber: string;

    @IsNotEmpty({
        message: '邮箱不能为空',
    })
    @IsEmail(
        {},
        {
            message: '不是合法的邮箱格式',
        },
    )
    @ApiProperty({description: '邮箱', required: true})
    email: string;

    @IsNotEmpty({
        message: '验证码不能为空',
    })
    @ApiProperty({description: '验证码', required: true})
    captcha: string;
}
